#ifndef USERCONFIGS_H
#define USERCONFIGS_H

#include <QString>
#include "cnsMacroGlobal.h"
#include <QSettings>
#include "cnsComponent.h"

class UserConfigs : public CnsComponent
{
    Q_OBJECT
private:

public:
    QSettings* m_iniFile;

public:
    void settings_init();
    void setValue(const QString &section, const QString &key, const QString &value);
    void removeNode(const QString &section);
    void removeKey(const QString &section, const QString &key);
    QString getValue(const QString &section, const QString &key);

    Q_INVOKABLE UserConfigs();

    void saveConfigFile();
    ~UserConfigs(){
        delete m_iniFile;
    }
};

CNS_COM_DECL_METATYPE(UserConfigs);

#endif // USERCONFIGS_H
